import  * as actionType from './actionType'

export default (state={},action)=>{
        switch(action.type){
            case actionType.GETALLCAMERAS:{
                return{
                    ...state, cameraList:action.payload
                }
            }
            case actionType.ALARMDETAILS:{
                return{
                    ...state, Alarmdetails:action.payload ,pageTotal:action.pageTotal
                }
            }
            case actionType.GETHISTORY:{
                return{
                    ...state, historyList:action.payload
                }
            }
            case actionType.GETALARMDETAILS:{
                return{
                    ...state ,GetAlarmdetails:action.payload
                }
            }
            case actionType.GETPATROLWORKERS:{
                return{
                    ...state ,Listofworkers:action.payload
                }
            }
            case actionType.SEARCHALARM:{
                return{
                    ...state, Alarmdetails:action.payload ,pageTotal:action.pageTotal
                }
            }
            case actionType.GETWEEKWARN:{
                return{
                    ...state,OneWeekWarns:action.payload
                }
            }
            default:
                return state
        }
}